/*
 * @Author: zhang·xiao
 * @Date: 2022-11-07 22:02:56
 * @LastEditors: zhang·xiao
 * @LastEditTime: 2022-11-30 19:04:31
 * @Description: 描述文件功能
 */
// main.js
import Vue from 'vue'
import App from './src/App.vue'
import router from './src/router/index.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// 本地安装组件测试的包
// import XFSMUI from 'xfsm-ui'
// import 'xfsm-ui/lib/theme/index.css'

import XFSMUI from '../packages/element-ui/index.js'
import XFSMBUI from '../packages/business-ui/index.js'
import '../packages/element-ui/styles/src/index.scss'

Vue.use(ElementUI)
Vue.use(XFSMUI)
Vue.use(XFSMBUI)

const creatApp = async () => {
  try {
    await XFSMUI.updateUITheme({
      primaryColor: '#FFAA00',
      primarySecondColor: '#231909'
    })

    new Vue({
      el: '#app',
      router,
      render: (h) => h(App)
    }).$mount()
  } catch (error) {
    new Vue({
      el: '#app',
      router,
      render: (h) => h(App)
    }).$mount()
    console.error('主题更新失败')
  }

}

creatApp()
